Add CI workflow to build/package the VS extension - #30
Merged
Conversation
Models reqnroll/Reqnroll.VisualStudio's ci.yml (the legacy VS extension CI this repo is meant to replace): a windows-latest runner and microsoft/setup-msbuild, since VSIX packaging goes through Microsoft.VSSDK.BuildTools targets rather than a plain cross-platform dotnet build. Unlike the legacy net481 classic-VSSDK project (which needs an explicit msbuild.exe invocation with -p:DeployExtension=false), this repo's extension is an SDK-style csproj on the modern VisualStudio.Extensibility SDK, and `dotnet build`/`dotnet test` were verified locally to produce a working .vsix and pass all 74 Reqnroll.VisualStudio.Tests — so the workflow uses dotnet directly, keeping setup-msbuild only to put msbuild.exe on PATH for the VSSDK targets that shell out to it. Scoped to build+test+package only, no signing/Marketplace publish step, matching this repo's existing build-vscode-extension.yml pattern (env block, path-filtered triggers, upload-artifact with if-no-files-found: error). Closes #29 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reqnroll.IdeSupport.LSP.Server.csproj's BuildConnector target invokes Connector.csproj via a direct <MSBuild Targets="Build"> task call rather than a ProjectReference (multi-targeted projects don't expose GetTargetPath at the outer build level), so `dotnet restore` on the extension/tests project never restores it. Both CI jobs failed on a clean runner with NETSDK1004 (missing project.assets.json) as a result. Mirrors the "Restore Connector" step already present in build-vscode-extension.yml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #29 — adds
.github/workflows/build-vs-extension.yml, a CI workflow that builds, tests, and packages the Visual Studio extension (src/VisualStudio/Reqnroll.IdeSupport.VisualStudio.Extension).Conventions followed from
reqnroll/Reqnroll.VisualStudio'sci.ymlThat repo's CI is the closest real-world analog for this task, since it's the legacy VS extension this project is meant to replace. It was fetched and read directly (
gh api repos/reqnroll/Reqnroll.VisualStudio/contents/.github/workflows/ci.yml). Key conventions carried over:windows-latestrunner — VSIX packaging needs Windows, not theubuntu-latestused byreqnroll/Reqnroll's core CI or this repo's ownbuild-vscode-extension.yml.microsoft/setup-msbuildto putmsbuild.exeon PATH, since VSSDK packaging targets shell out to it even during adotnet build/dotnet testinvocation.dotnet restorebefore build, matching the explicit restore-then-build split in theirbuildjob.actions/upload-artifact@v4withif-no-files-found: errorfor the VSIX and test results, and separating build vs. test into distinct jobs (mirroring theirbuild/connector-tests/specs-testssplit).One deliberate divergence:
Reqnroll.VisualStudio's legacy project is a classic net481 VSSDK package and needs an explicitmsbuild -property:DeployExtension=false ...invocation to build. This repo's extension is an SDK-style csproj on the modernMicrosoft.VisualStudio.ExtensibilitySDK (withVssdkCompatibleExtension/GeneratePkgDefFilefor VSIX packaging). I verified locally that plaindotnet build/dotnet testalready produce a working.vsixand pass all tests, so the workflow usesdotnetdirectly rather than blindly copying themsbuild.exeinvocation —setup-msbuildis kept only so the VSSDK build targets can findmsbuild.exeon PATH.Also skimmed
reqnroll/Reqnroll's ownci.ymlfor org-wide conventions (env block for shared vars, path-filtered/branch-filtered triggers,workflow_dispatch) — those already match this repo'sbuild-vscode-extension.ymlstyle, so no changes needed there.Scope
No signing or Visual Studio Marketplace publish step is included — this repo has no marketplace credentials/secrets configured yet, and that's a decision for the maintainer. This matches
build-vscode-extension.yml, which also stops at packaging the.vsixwithout publishing.reqnroll/Reqnroll.VisualStudio'sreleasejob (usingCodingWithCalvin/GHA-VSMarketplacePublisher) is the reference to adopt later if/when publishing is desired.Test plan
Locally validated (Windows, .NET SDK 10.0.301) by running the exact command sequence each job uses:
dotnet restore src/VisualStudio/Reqnroll.IdeSupport.VisualStudio.Extension/Reqnroll.IdeSupport.VisualStudio.Extension.csproj— succeedsdotnet build ... --no-restore --configuration Release— succeeds, producesReqnroll.IdeSupport.VisualStudio.Extension.vsixunderbin/Release/net481/(also verified Debug config separately)dotnet restore tests/VisualStudio/Reqnroll.VisualStudio.Tests/Reqnroll.VisualStudio.Tests.csproj— succeedsdotnet test ... --no-restore --configuration Release --logger trx— 74/74 tests passNot locally validated:
microsoft/setup-msbuilditself (no MSBuild.exe present in this dev environment to compare against) — the build succeeded without it locally becausedotnet buildresolves the VSSDK targets/tools it needs from the restored NuGet packages, but I kept the action in the workflow per the reference repo's convention and because GitHub'swindows-latestrunner has a full VS Build Tools install where those targets may still shell out tomsbuath.exefrom PATH for manifest/pkgdef steps. This should be confirmed once the workflow runs onwindows-latestin Actions.